package com.kafka.demo.utils;


import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;

//@Data
@Slf4j
public class Listener {
//    private final Logger logger = LoggerFactory.getLogger(this.getClass());


    @KafkaListener(topics = "${kafka.consumer.topic}")
    public void listen(ConsumerRecord<?, ?> record) {
        log.info("kafka的key: " + record.key());
        log.info("kafka的value: " + record.value().toString());
    }
//    @KafkaListener(topics = "trendy")
//    public void listen2(ConsumerRecord<?, ?> record) {
//        log.info("kafka的key: " + record.key());
//        log.info("kafka的value: " + record.value().toString());
//    }

}